using Light;
using Light.Assets.Scripts.EventManager;
using UnityEngine;

namespace Dream
{
    public class PanelController : MonoBehaviour
    {
        [SerializeField] private GameObject _summaryPanelGameObject;

        private void Awake()
        {
            EventManager.Register<OpenSummaryPanelEvent>(OnOpenSummaryPanelEventHandle);
        }

        private void OnDestroy()
        {
            EventManager.Unregister<OpenSummaryPanelEvent>(OnOpenSummaryPanelEventHandle);
        }

        private void OnOpenSummaryPanelEventHandle(OpenSummaryPanelEvent obj)
        {
            _summaryPanelGameObject.SetActive(true);
        }
    }
}